package cn.majingjing.core.file;

import java.io.File;

import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author majinding888@foxmail.com
 */
public class TmFileTools {

	private static Logger log = LoggerFactory.getLogger(TmFileTools.class);

	public static File newFile(String file) {
		File f = new File(file);
		try {
			if (!f.getParentFile().exists()) {
				FileUtils.forceMkdir(f.getParentFile());
			}
		} catch (Exception e) {
			log.error("获取文件失败", e);
		}
		return f;
	}

}
